package com.qfedu.controrller;

import com.qfedu.entity.ResultVo;
import com.qfedu.service.ProductService;
import com.qfedu.vo.ProductIdsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.*;


/**
 * 作者：刘随阳
 * 时间: 2021/9/20 14:55
 * 描述：神光照耀,太白成瑞。六丙来迎,百福悠归
 */
@RestController
@RefreshScope
@RequestMapping("product")
public class ProductController {

    @Autowired
    private ProductService productService;

    @GetMapping("/getIndexProduct/{productType}")
    public ResultVo getIndexProduct(@PathVariable Integer productType){
        return productService.getIndexProduct(productType);
    }

    @GetMapping("/getProductDetail/{productId}")
    public ResultVo getProductDetail(@PathVariable Integer productId,@RequestHeader String token){
        return productService.getProductDetail(productId,token);
    }



    @GetMapping("/getOrderParams")
    public ResultVo getOrderParams(Integer productId,Integer skuId,Integer dateId){
        return productService.getOrderParams(productId,skuId,dateId);
    }

}
